//
//  HSLiveListVM.m
//  HolyShit
//
//  Created by Robin on 2017/3/30.
//  Copyright © 2017年 HolyShit. All rights reserved.
//

#import "HSLiveListVM.h"

@implementation HSLiveListVM

- (RACCommand *)refreshCommand
{
    if (!_refreshCommand) {
        @weakify(self);
        _refreshCommand = [RACCommand commandWithSignalBlock:^RACSignal *(id input) {
            @strongify(self);
            NSString *url = @"http://sportslive.firstblod.com/json/zhibo/saishi.json";
            return [[MYHttpHelper shareHelper] rac_getWithUrl:url params:nil success:^(NSDictionary *dict) {
                self.topics = [NSArray modelArrayWithClass:[HSLiveListModel class] json:dict[@"responseText"]];
            } failed:^(NSError *error) {
                
            }].racSignal;
        }];
    }
    return _refreshCommand;
}

@end
